@extends('admin.common.admin_main')
@section('container')
    @include('UEditor::head')
<div class="uc-body">
    <div class="uc-head">
        <ul>
            <li><span>编辑案例</span></li>
        </ul>
    </div>
    <div class="form form-horizontal">
        <div class="form-body">
            <div class="row">
                <div class="label"><span class="require">*</span>案例技术：</div>
                <span id="tech_chose_area"><label id="selected_tech" tech-id="{{$tech_id}}">{{$tech_name}}</label></span>
                <div class="control-text" >
                    <a class="btn btn-small btn-primary j_techChose">选择技术</a>
                </div>
            </div>

            <div class="row">
                <div class="label"><span class="require">*</span>案例名称：</div>
                <div class="control-text">
                    <input id="case_name" class="form-control form-control-lg" type="text" value="{{$dataInfo['case_name']}}">
                </div>
            </div>
            <div class="row">
                <div class="label"><span class="require">*</span>案例地区：</div>
                <div class="control-text">
                    <select id="case_address" class="form-control">
                        <option value="-1">请选择</option>
                        @foreach ($province_list as $key=>$value)
                            <option value="{{$value['id']}}" {{$dataInfo['case_address_id']==$value['id']?"selected=selected":""}}>{{$value['name']}}</option>
                        @endforeach
                    </select>
                </div>
            </div>
            <div class="j_selectPane j_caseDomain">
                <div class="row">
                    <div class="label"><span class="require">*</span>应用领域：</div>
                    <div class="control-text">
                        <div class="select-pane j_selectItems">
                            <ul class="val">
                                @foreach ($selectDomainList as $key=>$value)
                                    <li><input type="hidden" value="{{$value}}" name="case_domain" /> {{$getNameList[$value]['name']}}</li>
                                @endforeach
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="control-text">
                        <select class="form-control" id="domain_change">
                        @foreach ($domain_list as $key=>$value)
                                <option value="{{$value['id']}}">{{$value['name']}}</option>
                            @endforeach
                        </select>
                        <select class="form-control">
                            @foreach ($domain_list2 as $key=>$value)
                                <option value="{{$value['id']}}">{{$value['name']}}</option>
                            @endforeach
                        </select>
                        <a class="btn btn-primary j_selectBtn" data-name="case_domain">添加</a>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="label"><span class="require">*</span>案例图片：</div>
                <div class="control-text j_fileUpload">
                    <div class="file_list">
                        <ul class="j_fileList">
                            @forelse ($dataInfo['case_image'] as $key=>$value)
                                <li>
                                    <img src="{{$value['url']}}" width="88" height="88" alt="">
                                    <a class="j_delImg">×</a>
                                        <input class="j_originalName" type="hidden" value="{{$value['name']}}">
                                        <input class="j_remoteName" type="hidden" value="{{$value['url']}}">
                                        <input class="j_md5" type="hidden" value="{{$value['md5']}}">
                                        <input class="j_thumbUrl" type="hidden" value="{{$value['thumbUrl']}}">
                                </li>
                            @empty
                            @endforelse

                        </ul>
                    </div>
                    <div class="file_select">
                        <div class="form-control-static">
                            <a class="btn btn-small btn-primary">浏览</a>
                            <input id="fileUpload" class="txt_file j_fileSelect" data-multi="true" name="files" type="file">
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="label"><span class="require">*</span>案例介绍：</div>
                <div class="control-text">
                    <script id="case_content" name="content" type="text/plain">{!! $dataInfo['case_content'] !!}</script>
                </div>
            </div>
            <div class="row">
                <div class="label">&nbsp;</div>
                <div class="control-text">
                    <input id="case_id" type="hidden" value="{{$case_id}}">
                    <a class="btn btn-warning j_caseSave" data-chk="1">保存</a>
                    <a class="btn btn-primary j_caseSave" data-chk="2">保存并提交审核</a>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="pop-bg j_popBg" style="display: none"></div>
<div class="pop pop-body j_popFrame" style="display: none">
    <a class="close j_frameClose">关闭</a>
    <iframe id="iFrame" src="" width="100%" scrolling="yes" marginheight="0" frameborder="0"></iframe>
</div>
@endsection

@section('script')
<script src="{{env('STATIC_PATH')}}/libs/ajaxfileupload.js"></script>
<script src="{{env('STATIC_PATH')}}/js/user_tech_case.js"></script>
<script type="text/javascript">
(function($){
    $(function(){
        //选择技术
        $(".j_techChose").click(function () {
            var $t = $(this);
            $("#iFrame").attr("src", "/user/case_tech_chose");
        });
    })
})(jQuery);
</script>
@endsection
